package com.tuanzi.loan.security;

import com.tuanzi.loan.business.entity.CurrentUser;
import com.tuanzi.loan.business.entity.LoginUser;
import org.springframework.data.domain.AuditorAware;
import org.springframework.stereotype.Component;

@Component
public class AuditorAwareImpl implements AuditorAware<String> {

    @Override
    public String getCurrentAuditor() {
        LoginUser loginUser = CurrentUser.get();
        return loginUser == null ? "系统操作" : loginUser.getName();
    }

}